<?php

/*
|--------------------------------------------------------------------------
| Routes File
|--------------------------------------------------------------------------
|
| Here is where you will register all of the routes in an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

Route::get('/', function () {
    return view('welcome');
});

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| This route group applies the "web" middleware group to every route
| it contains. The "web" middleware group is defined in your HTTP
| kernel and includes session state, CSRF protection, and more.
|
*/

Route::group(['middleware' => ['web']], function () {

    Route::get('question',['as' => 'Home.Page.index', 'uses' => 'QuestionsController@index']);
    Route::get('analys',['as' => 'Home.Page.analys', 'uses' => 'QuestionsController@analys']);
    Route::get('content',['as' => 'Home.Page.content', 'uses' => 'HomeController@content']);
    Route::get('manhualist',['as' => 'Home.Page.manhualist', 'uses' => 'HomeController@manhualist']);
    Route::get('manhuaImgList',['as' => 'Home.Page.manhuaImgList', 'uses' => 'HomeController@manhuaImgList']);


    Route::group(['prefix'=>'admin'],function(){
        Route::get('login',['as' => 'Admin.Home.login', 'uses' => 'AdminController@login']);
        Route::get('question-list',['as' => 'Admin.Home.questionList', 'uses' => 'AdminController@questionList']);
        Route::get('question-add',['as' => 'Admin.Home.questionAdd', 'uses' => 'AdminController@questionAdd']);
        //新增测试
        Route::get('daka-content-list',['as' => 'Admin.Home.dakaContentList', 'uses' => 'AdminController@dakaContentList']);
        Route::get('answer-list',['as' => 'Admin.Home.answerList', 'uses' => 'AdminController@answerList']);
        Route::get('answer-set',['as' => 'Admin.Home.answerSet', 'uses' => 'AdminController@answerSet']);
        Route::get('daka-content-set',['as' => 'Admin.Home.dakaContentSet', 'uses' => 'AdminController@dakaContentSet']);
        Route::get('user-list',['as' => 'Admin.Home.userList', 'uses' => 'AdminController@userList']);
        Route::get('banner-list',['as' => 'Admin.Home.bannerList', 'uses' => 'AdminController@bannerList']);
        Route::get('banner-set',['as' => 'Admin.Home.bannerSet', 'uses' => 'AdminController@bannerSet']);
        Route::get('feedback-list',['as' => 'Admin.Home.feedbackList', 'uses' => 'AdminController@feedbackList']);
        Route::get('change-pwd',['as' => 'Admin.Home.changePwd', 'uses' => 'AdminController@changePwd']);
        Route::get('classify-list',['as' => 'Admin.Home.classifyList', 'uses' => 'MyLifeController@classifyList']);
        Route::get('content-list',['as' => 'Admin.Home.contentList', 'uses' => 'MyLifeController@contentList']);
        Route::get('content-set',['as' => 'Admin.Home.contentSet', 'uses' => 'MyLifeController@contentSet']);
        Route::get('list-list',['as' => 'Admin.Home.listList', 'uses' => 'MyLifeController@listList']);
        Route::get('contents-list',['as' => 'Admin.Home.contentsList', 'uses' => 'AdminController@contentsList']);
        Route::get('contents-set',['as' => 'Admin.Home.contentsSet', 'uses' => 'AdminController@contentsSet']);
        Route::get('comic-list',['as' => 'Admin.Home.comicList', 'uses' => 'AdminController@comicList']);
        Route::get('comic-img-list',['as' => 'Admin.Home.comicImgList', 'uses' => 'AdminController@comicImgList']);


    });

    Route::group(['prefix'=>'api', 'namespace'=>'Api'],function(){
        Route::get('get-question',['as'=>'Api.Question.getQuestion','uses'=>'QuestionController@getQuestion']);
        Route::post('check-answer', ['as' => 'Api.Question.checkAnswer', 'uses' => 'QuestionController@checkAnswer']);
        Route::post('add-answer', ['as' => 'Api.Question.setAnswer', 'uses' => 'QuestionController@setAnswer']);
        Route::post('set-question', ['as' => 'Api.Question.setQuestion', 'uses' => 'QuestionController@setQuestion']);
        Route::post('change-answer', ['as' => 'Api.Question.changeAnswer', 'uses' => 'QuestionController@changeAnswer']);
        Route::post('del-answer', ['as' => 'Api.Question.delAnswer', 'uses' => 'QuestionController@delAnswer']);
        Route::post('del-question', ['as' => 'Api.Question.delQuestion', 'uses' => 'QuestionController@delQuestion']);

        Route::group(['prefix' => 'admin','namespace'=>'Admin'],function(){
            Route::post('auth/sign-in',['as'=>'Api.Admin.Auth.signInAdmin','uses'=>'AuthController@signInAdmin']);
            Route::post('auth/change-pwd',['as'=>'Api.Admin.Auth.changePassword','uses'=>'AuthController@changePassword']);
            Route::post('daka/setDakaContent',['as'=>'Api.Admin.daka.setDakaContent','uses'=>'DakaController@setDakaContent']);
            Route::post('daka/delDaka',['as'=>'Api.Admin.daka.delDaka','uses'=>'DakaController@delDaka']);
            Route::post('sys/setBanner',['as'=>'Api.Admin.sys.setBanner','uses'=>'SystemController@setBanner']);
            Route::post('sys/delBanner',['as'=>'Api.Admin.sys.delBanner','uses'=>'SystemController@delBanner']);
            Route::get('auth/signOut',['as'=>'Api.Admin.Auth.signOut','uses'=>'AuthController@signOut']);
            Route::post('sys/addClassify',['as'=>'Api.Admin.sys.addClassify','uses'=>'SystemController@addClassify']);
            Route::post('sys/delClassify',['as'=>'Api.Admin.sys.delClassify','uses'=>'SystemController@delClassify']);
            Route::post('sys/setContent',['as'=>'Api.Admin.sys.setContent','uses'=>'SystemController@setContent']);
            Route::post('sys/delContent',['as'=>'Api.Admin.sys.delContent','uses'=>'SystemController@delContent']);
            Route::post('sys/setList',['as'=>'Api.Admin.sys.setList','uses'=>'SystemController@setList']);
            Route::post('sys/delList',['as'=>'Api.Admin.sys.delList','uses'=>'SystemController@delList']);
            Route::post('sys/setContents',['as'=>'Api.Admin.sys.setContents','uses'=>'SystemController@setContents']);
            Route::post('sys/delContents',['as'=>'Api.Admin.sys.delContents','uses'=>'SystemController@delContents']);
            Route::post('comic/setComic',['as'=>'Api.Admin.Comic.setComic','uses'=>'ComicController@setComic']);
            Route::post('comic/setComicImg',['as'=>'Api.Admin.Comic.setComicImg','uses'=>'ComicController@setComicImg']);
            Route::post('comic/delContents',['as'=>'Api.Admin.Comic.delContents','uses'=>'ComicController@delContents']);
            Route::post('comic/delComicImg',['as'=>'Api.Admin.Comic.delComicImg','uses'=>'ComicController@delComicImg']);
        });

        Route::group(['prefix' => 'file'],function(){
            Route::post('upload-img',['as'=>'Api.File.upload','uses'=>'ImageController@upload']);
            Route::get('show-image/{id}',['as'=>'Api.File.showImageById','uses'=>'ImageController@showImageById']);
            Route::post('upload-user-photo',['as'=>'Api.File.uploadUserPhoto','uses'=>'ImageController@uploadUserPhoto']);
        });

         Route::group(['prefix' => 'ucenter'],function(){
             Route::get('get-userinfo',['as'=>'Api.Ucenter.getUserInfo','uses'=>'UcenterController@getUserInfo']);
             Route::get('get-my-daka-list',['as'=>'Api.Ucenter.getMyDakaList','uses'=>'UcenterController@getMyDakaList']);
             Route::post('set-userinfo',['as'=>'Api.Ucenter.setUserInfo','uses'=>'UcenterController@setUserInfo']);
             Route::get('get-ranking',['as'=>'Api.Ucenter.getRanking','uses'=>'UcenterController@getRanking']);
             Route::post('set-feedback',['as'=>'Api.Ucenter.setFeedback','uses'=>'UcenterController@setFeedback']);
             Route::get('get-message-list',['as'=>'Api.Ucenter.getMessageList','uses'=>'UcenterController@getMessageList']);
         });

        Route::group(['prefix' => 'daka'],function(){
            Route::get('get-banner-list',['as'=>'Api.Daka.getBannerList','uses'=>'DakaController@getBannerList']);
            Route::get('get-daka-detail',['as'=>'Api.Daka.getActiveDaka','uses'=>'DakaController@getActiveDaka']);
            Route::post('send-daka-content',['as'=>'Api.Daka.sendDakaContent','uses'=>'DakaController@sendDakaContent']);
            Route::post('set-user-like',['as'=>'Api.Daka.setUserLike','uses'=>'DakaController@setUserLike']);
            Route::get('get-daka-list',['as'=>'Api.Daka.getDakaList','uses'=>'DakaController@getDakaList']);
            Route::post('buildShareImg',['as'=>'Api.Daka.buildShareImg','uses'=>'DakaController@buildShareImg']);
            Route::get('show-share-img',['as'=>'Api.Daka.showShareImg','uses'=>'DakaController@showShareImg']);
            Route::get('getToken',['as'=>'Api.Daka.getToken','uses'=>'DakaController@getToken']);
        });

        Route::group(['prefix' => 'auth'],function(){
            Route::any('wxLogin',['as'=>'Api.Auth.wxLogin','uses'=>'AuthController@wxLogin']);
        });
    });
});
